﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PblReader
{
    public class PblEntry
    {
        private static HashSet<string> _sourceExtentions = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
            {
               "sra", "srd", "srf", "srj", "srm", "srp", "srs", "sru", "srw"
            };

        public string PblVersion { get; set; }
        public long OffsetFirstDataBlock { get; set; }
        public long ObjectSize { get; set; }
        public DateTime Timestamp { get; set; }
        public string ObjectName { get; set; }
        public int CommentSize { get; set; }

        public bool IsBinary
        {
            get
            {
                return !this.IsSource;
            }
        }

        public bool IsSource
        {
            get
            {
                var ext = this.ObjectName.Substring(this.ObjectName.Length - 3);

                return _sourceExtentions.Contains(ext);
            }
        }
    }
}
